package vn.pyco.prez.dao.impl;

import java.util.HashMap;
import java.util.Map;

import vn.pyco.prez.dao.DaoManager;

public class InMemoryDaoManager<T> implements DaoManager<T> {
	private Map<String, T> _database;
	
	public InMemoryDaoManager() {
		_database = new HashMap<String, T>();
	}

	@Override
	public T getById(String id) {
		return _database.get(id);
	}

	@Override
	public void save(String id, T object) {
		_database.put(id, object);
	}

	@Override
	public void delete(String id) {
		_database.remove(id);
	}

}
